-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
TST: Replace ensure_clean_store with tmp_path in test_complex.py, test_file_handling.py #63214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
TST: Replace ensure_clean_store with tmp_path in test_complex.py, test_file_handling.py #63214
Conversation
f981616 to
1b5b02c
Compare
Add HDFStore and remove ensure_clean_store imports, use tmp_path / setup_path with HDFStore instead.
|
Hi @mroeschke! 👋 Would you mind reviewing this PR (for #62435) and letting me know if there are any changes needed on my end in order to successfully merge? Thank you in advance! |
|
Hi @rhshadrach and @mroeschke, just wanted to kindly request feedback from either of you whenever you have a chance. I appreciate you both taking a look; whoever is able to review is perfect, and I’m happy to respond to any feedback. Thanks so much! |
| from pandas.tests.io.pytables.common import ensure_clean_store | ||
|
|
||
| from pandas.io.pytables import read_hdf | ||
| tables = pytest.importorskip("tables") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke I added that line because pytables (and its HDF5 dependency) aren't available in the Pyodide environment. Thus it skips those tests but keeps full test coverage where the dependency is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is effectively called in pandas/tests/io/pytables/common.py already so it's not needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke Thanks! I have removed the importorskip("tables") and included from pandas.tests.io.pytables.common import tables.
from pandas.tests.io.pytables.common import tables
_ = tables
However, I'm seeing this error frequently come up: Error: ENOENT: no such file or directory, lstat '/home/runner/work/_temp/setup-micromamba/micromamba-shell' This appears to be an issue with the post-run cleanup phase and seems unrelated to my changes. Could you please trigger a retry of the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just remove these lines all together. I would consider this an unrelated change that can be addressed in a follow up if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke Awesome, I just deleted those two lines as requested.
I still have failing automated tests, but I noticed that they're the same as what's failing in the main branch so they're unrelated to my changes. I believe it's ready for another review!
ensure_cleanutility function with thetemp_filepytest fixture #62435Replace ensure_clean_store with tmp_path fixture in the following files:
pandas/tests/io/pytables/test_keys.pypandas/tests/io/pytables/test_complex.pypandas/tests/io/pytables/test_file_handling.pySpecifically,
ensure_clean_storewith +HDFStore(tmp_path / setup_path)tmp_pathparameter to modified test functions=====
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.AGENTS.md.